﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.RoleCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;
using System.Data;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.RoleHandler
{
    public class RoleShowCommandHandlers : IRequestHandler<RoleShowCommand, FenYeDTO<RoleInfo>>
    {
        IRoleService rSer;

        public RoleShowCommandHandlers(IRoleService rSer)
        {
            this.rSer = rSer;
        }
        public async Task<FenYeDTO<RoleInfo>> Handle(RoleShowCommand request, CancellationToken cancellationToken)
        {
            return await rSer.GetRole(request.poageiden, request.pageSzen, request.Name);
        }
    }
}
